<?php
/**
 * Created by PhpStorm.
 * User: 张天硕
 * Date: 2017/3/22
 * Time: 11:52
 */

namespace app\admin\controller;


use think\Controller;

class Admin extends Controller{
    /*
     * 前置过滤器
     */
    protected $beforeActionList = [
        'first',
        'second'=>['except'=>'hello'],//只有hello方法不经second方法过滤
        'three'=>['only'=>'hello,data'],//只有hello，data方法经过three过滤
    ];
    protected function first(){
        echo 'first<br/>';
    }

    protected function second(){
        echo 'second<br/>';
    }

    protected function three(){
        echo 'three<br/>';
    }

    public function hello(){
        return '你好';
    }

    public function data(){
        return '数据';
    }

    public function index(){
        return '首页';
    }
}